var sys = require('sys');

exports.create = function() {
  return new Game();
}

function Game() {
  this.playerList = [];
  
  sys.log("Game:construct");
  
  this.size = function() {
    return this.playerList.length;
  }
  
  this.add = function(newPlayer) {
    sys.log("QueuePool:add");
    
    this.playerList.push(newPlayer);
  }
  
  this.isFinished = function() {
    return false;
  }
  
  this.inCountdown = function() {
    return false;
  }
  
  this.onScore = function() {
    return false;
  }
  
  this.contains = function(id) {
    return (this.get(id));
  }
  
  this.get = function(id) {
    for(var i = 0; i < this.playerList.length; i++)
    {
      if(this.playerList[i].id == id)
        return this.playerList[i];
    }

    return null;
  }
}